home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 January & February / rerun-1986-01-02.d64 / disk renamer 64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  60 lines

  1. 1 rem *********************
  2. 2 rem * disk name changer *
  3. 3 rem *        by         *
  4. 4 rem *    bob dickow     *
  5. 5 rem *********************
  6. 6 :
  7. 70 rem --initialize & display screen--
  8. 80 q$=chr$(34): ar$=chr$(95): bk$=chr$(20): de$="[157]-[157]": ch$=chr$(221)
  9. 90 bx$="           [213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]":by$="           [202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  10. 100 dh$=chr$(166):forx=1to40:ln$=ln$+dh$:next:r$=chr$(13): disk=8
  11. 110 forx=1to16:sp$=sp$+chr$(160):bl$=bl$+"-":next
  12. 120 print"[147][158]         ***disk name changer***"
  13. 130 print:print"    "q$;ar$;q$" = abort the change or exit"
  14. 140 print"    "q$"inst/del"q$" = delete a character"
  15. 150 print"    hit "q$"return"q$" key to enter change.":print
  16. 160 println$
  17. 170 print" insert disk & hit ";q$;"return"q$" when ready"
  18. 180 cu=0: gosub 520
  19. 190 ifa$=ar$ then print"[147]":end
  20. 200 ifa$<>r$ thenprint"[145]";:goto170
  21. 210 open 15,8,15:print#15,"i0":gosub 570
  22. 220 rem --get disk name from bam--
  23. 230 b$="": open8,di,8,"#":print#15,"ua:";8;0;18;0:print#15,"b-p:";8;144
  24. 240 forx=1to20:get#8,a$:b$=b$+a$:next
  25. 250 close8: close 15
  26. 260 nm$=left$(b$,16):id$=right$(b$,2)
  27. 270 print"[145] current disk name: "nm$;",";id$:b$=""
  28. 280 print"  type new disk name (16 chrs maximum): ":print bx$
  29. 290 print spc(11);ch$;bl$;ch$:printby$:print"[145][145]";spc(12);
  30. 300 cu=1:gosub520
  31. 310 ifa$=r$ and peek(211)<>28then print"-[157]";:goto 410
  32. 320 z=len(b$):ifa$=r$ then 410
  33. 330 if a$=bk$ and z=0 then300
  34. 340 ifa$=bk$andpeek(211)=28thenprint ch$"[157]";de$;:b$=left$(b$,z-1):goto300
  35. 350 ifa$=bk$then print"-[157]";de$;:b$=left$(b$,z-1):goto300
  36. 360 ifa$=ar$ then b$="":print:print"[145]aborted":goto 480
  37. 370 ifa$="[145]"ora$=""ora$=""ora$="[147]"ora$=""ora$="[157]"then300
  38. 380 ifz<16thenb$=b$+a$:cu=1:printa$;
  39. 390 z=len(b$):goto300
  40. 400 rem --write to disk routine--
  41. 410 open15,di,15:open 8,di,8,"#":forx=1to2:print#15,"b-p:"8;144
  42. 420 ifx=1thenprint#8,sp$;:next
  43. 430 print#8,b$;
  44. 440 print#15,"u2:"8;0;18;0:gosub 570
  45. 450 close8:close15
  46. 460 print:printspc(20);"[145][145][145][145][145][145]";b$;
  47. 470 printright$(sp$,16-len(b$));","id$;""
  48. 480 print:print spc(12)"continue?  (y/n)[157][157][157][157]";:cu=1:gosub520
  49. 490 ifa$="y" or a$=r$ then poke 204,1:print:goto120
  50. 500 print:end
  51. 510 rem --input subroutine--
  52. 520 geta$:if cu then poke 204,0:poke 207,0
  53. 530 if cu and a$="" and peek(211)=28 then cu=0:poke204,1:print ch$"[157]";
  54. 540 if a$=""then 520
  55. 550 poke204,1:return
  56. 560 rem --error check subroutine--
  57. 570 input#15,e,e$,t,s
  58. 580 ife>=20thenprint:print"error#"e;""e$:close8:close 15:end
  59. 590 return
  60.